/**
   COPYRIGHT (C) 2007 Natasha Khuri. All Rights Reserved.
   A class that defines a Square
   @author Natasha Khuri
   @version 1.0  2007/09/21
*/

import java.awt.Rectangle;
import java.awt.Graphics2D;
import java.awt.Color;

/**
   Class to create a square object and draw it
*/
public class Square
{
   public Square(int x, int y, int w, Color c)
   {
      xCoor = x;
      yCoor = y;
      width = w;
      color = c;
   }

   /**
      creates and draws a square
      @param g2 Graphics2D object
   */

   public void draw(Graphics2D g2)
   {
      Rectangle mySquare = new Rectangle(xCoor, yCoor, width, width);
      g2.setColor(color);
      g2.fill(mySquare);
   }

   //instance variables
   private int xCoor;
   private int yCoor;
   private int width;
   private Color color;
}